mod add;
mod sub;
mod multip;
mod operation;
use crate::add::add_fn;
use crate::sub::*;
// pub use crate::sub::sub_fn;
// use crate::multip;

mod my_module {
    pub fn my_module_fn(a: i32, b: i32) -> i32 {
        a + b
    }
}

mod outer {
    pub mod inner {
        pub fn say_hello() {
            println!("Hello from inner module!");
        }
    }
}

fn main() {
    let result = add_fn(1,2);
    println!("Result: {}", result);

    let result = sub_fn(10,5);
    println!("Result: {}", result);

    let result = other_module_fn(2,5);
    println!("-----Result: {}", result);

    let result = multip::mul_fn(2,5);
    println!("Result: {}", result);

    let result = my_module::my_module_fn(2,5);
    println!("Result: {}", result);

    outer::inner::say_hello();

    print!("=========================================================\n");
    let result = operation::Add::add(2,5);
    println!("Result: {}", result);
    let result = operation::Sub::sub(10,5);
    println!("Result: {}", result);
    let result = operation::Mul::mul(2,5);
    println!("Result: {}", result);
    let result = operation::Div::div(10,2);
    println!("Result: {}", result);
    let result = operation::Div::sub_div::sub_div(9.0,2.0);
    println!("Result: {}", result);
    let result = operation::Div::sub_div::use_sup_div(100, 2);
    println!("Result: {}", result);

    print!("=========================================================\n");

    let a = 10;
    let b = 5;
    println!("Sum: {}", test_lib::add(a, b));
    println!("Difference: {}", test_lib::subtract(a, b));
    println!("Product: {}", test_lib::utils::multiply(a, b));
    
    match test_lib::utils::divide(a, b) {
        Some(result) => println!("Quotient: {}", result),
        None => println!("Cannot divide by zero!"),
    }
}
